package com.Maykk.Demo08;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @ClassName: ShowFileToTCP
 * @Description: TODO 服务器端 - 将文件中内容使用 TCP 传输并输出到
 * @Author: MaykkStar@163.com
 */
public class ShowFileToTCP {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(9527);
        Socket socket = serverSocket.accept();
        InputStream is = socket.getInputStream();
        BufferedReader br = new BufferedReader(new InputStreamReader(is));
        String line;
        while ((line = br.readLine()) != null) {
            System.out.println("文件 > " + line);
        }

        serverSocket.close();
    }
}
